package com.turing.data.scripts.zjtq.filter

import com.turing.common.util.Log
import com.turing.common.util.StringUtils
import com.turing.data.engine.utils.ScriptsUtils
import com.turing.data.vo.out.review.DependParamsVO
import com.turing.data.vo.out.review.TaskElementVO


/**
 * 场景名称：追加提取单
 * 要素名称：追加或提取
 **/

class AdditionOrWithdrawal_30227_34_filter {
    static List<TaskElementVO.DrawResultVO> doConvert(DependParamsVO dependParams) {

        List<TaskElementVO.DrawResultVO > resultVOs = ScriptsUtils.tryInitResult(dependParams)
        try {

            if (resultVOs != null && resultVOs.size() > 0) {

                List<TaskElementVO.DrawResultVO> defaultResultVOs = new ArrayList<>()
                TaskElementVO.DrawResultVO resultVO = resultVOs.get(0)
                String text = resultVO.getText()
                if (!StringUtils.isEmpty(text)) {
                    if (text.contains("追加")) {
//                        resultVO.setText("追加")
                        resultVO.setType(1)
                        resultVO.setBusinessValue("追加")
                    }
                    if (text.contains("提取")) {
//                        resultVO.setText("提取")
                        resultVO.setType(1)
                        resultVO.setBusinessValue("提取")
                    }
                }
                defaultResultVOs.add(resultVOs.get(0))
                return defaultResultVOs
            }

        } catch (Exception e) {
            Log.error(">>>>>>>>>>>eeeeeee")
            Log.error(e)
        }
        return resultVOs

    }

}
